package com.nanjia.boot.product.spu.model.form;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;

/**
 * 商品基础信息(SPU)表单对象
 *
 * @author 周洋
 * @since 2025-07-07 16:28
 */
@Getter
@Setter
@Schema(description = "商品基础信息(SPU)表单对象")
public class ProductSpuForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "SPU主键")
    private Long id;

    @Schema(description = "商品名称")
    @NotBlank(message = "商品名称不能为空")
    @Size(max=255, message="商品名称长度不能超过255个字符")
    private String spuName;

    @Schema(description = "分类ID")
    @NotNull(message = "分类ID不能为空")
    private Long categoryId;

    @Schema(description = "品牌ID")
    @NotNull(message = "品牌ID不能为空")
    private Long brandId;

    @Schema(description = "主图URL")
    @Size(max=512, message="主图URL长度不能超过512个字符")
    private String mainImage;

    @Schema(description = "详情图URL数组")
    @NotBlank(message = "详情图URL数组不能为空")
    private String detailImages;

    @Schema(description = "商品描述")
    @NotBlank(message = "商品描述不能为空")
    @Size(max=65535, message="商品描述长度不能超过65535个字符")
    private String description;

    @Schema(description = "状态(1:上架,0:下架)")
    @NotNull(message = "状态(1:上架,0:下架)不能为空")
    private Integer status;
}
